/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package isd.ventas.modelo;

import java.io.Serializable;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author ctrosch
 */
@Entity
@Table(name="VTTCPH")
public class VT_CondicionDePago implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name="VTTCPH_CNDPAG", length=6)
    private String cndpag;
    @Column(name="VTTCPH_DESCRP", length=60)
    private String descrp;

    @OneToMany(mappedBy = "condicionDePago", fetch=FetchType.LAZY)
    private List<VT_PlanDePago> cuotas;

    public String getCndpag() {
        return cndpag;
    }

    public void setCndpag(String cndpag) {
        this.cndpag = cndpag;
    }

    public String getDescrp() {
        return descrp;
    }

    public void setDescrp(String descrp) {
        this.descrp = descrp;
    }

    public List<VT_PlanDePago> getCuotas() {
        return cuotas;
    }

    public void setCuotas(List<VT_PlanDePago> cuotas) {
        this.cuotas = cuotas;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final VT_CondicionDePago other = (VT_CondicionDePago) obj;
        if ((this.cndpag == null) ? (other.cndpag != null) : !this.cndpag.equals(other.cndpag)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 23 * hash + (this.cndpag != null ? this.cndpag.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return "tv.venta.modelo.CondicionDePago[id=" + cndpag + "]";
    }

}
